﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PlaceMain.aspx.cs" Inherits="Pages_PlaceMain" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:HyperLink ID="hpCadastrarLocais" runat="server" 
            NavigateUrl="~/Pages/PlaceInsert.aspx">Cadastrar Locais</asp:HyperLink>
        <br />
    
        <asp:GridView ID="gvPlaces" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataSourceID="odsPlaces" ForeColor="#333333" 
            GridLines="None" onrowcommand="gvPlaces_RowCommand" DataKeyNames="Id">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" />
                <asp:BoundField DataField="ZipCode" HeaderText="ZipCode" 
                    SortExpression="ZipCode" />
                <asp:BoundField DataField="Address" HeaderText="Address" 
                    SortExpression="Address" />
                <asp:BoundField DataField="Complement" HeaderText="Complement" 
                    SortExpression="Complement" />
                <asp:BoundField DataField="Number" HeaderText="Number" 
                    SortExpression="Number" />
                <asp:TemplateField>
                  <ItemTemplate>
                       <asp:LinkButton runat= "server"  ID="lbUpdate" CommandArgument='<%# Bind("Id") %>' CommandName="UpdateData" target="_blank"> Alterar </asp:LinkButton>
                  </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                  <ItemTemplate>
                    <asp:LinkButton runat= "server"  ID="lbDelete" CommandArgument='<%# Bind("Id") %>' CommandName="ExcludeData" OnClientClick='javascript:return confirm("Confirma a exclusão deste local?")' > Excluir </asp:LinkButton>
                  </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
    
        <br />
    
        <asp:ObjectDataSource ID="odsPlaces" runat="server" SelectMethod="GetPlaces" 
            TypeName="br.com.SistemaChamados.Controller.PlaceController">
        </asp:ObjectDataSource>
        <br />
    
    </div>
    </form>
</body>
</html>
